package com.huo.dao;

import com.huo.pojo.Visit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface VisitRepository extends JpaRepository<Visit, Long> {

    @Transactional
    @Modifying
    @Query("update Visit v set v.glance = v.glance+1 where v.id = 1")
    int updateGlance();
}
